package com.lcn.comm.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>事务组对象</p>
 *
 * @author 张峰 zfvip_it@163.com
 * @create: 2017-12-14 10:00
 */
public class TxGroup implements Serializable {

    /**
     * 事务组id
     */
    private String groupId;

    /**
     * 事务组状态 0:失败 1:成功 默认0
     */
    private int state = 0;

    /**
     * 补偿请求
     */
    private int isCommit;

    /**
     * 开始时间
     */
    private Long startTime;

    /**
     * 是否关闭
     */
    private boolean hasOver = false;

    /**
     * 参与方事务列表
     */
    private List<TxRequest> list;

    public TxGroup() {
        list = new ArrayList<TxRequest>();
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public int getIsCommit() {
        return isCommit;
    }

    public void setIsCommit(int isCommit) {
        this.isCommit = isCommit;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public boolean isHasOver() {
        return hasOver;
    }

    public void setHasOver(boolean hasOver) {
        this.hasOver = hasOver;
    }

    public List<TxRequest> getList() {
        return list;
    }

    public void addRequest(TxRequest txRequest) {
        this.list.add(txRequest);
    }
}
